<template>
  <div class="dashboard">
    <el-card class="welcome-card">
      <template #header>
        <div class="card-header">
          <span>系统概览</span>
        </div>
      </template>
      <div class="welcome-content">
        <h3>欢迎使用年轮家族管理系统</h3>
        <p>年轮寓意文化代代相传，如树木年轮般记录家族历史。</p>
      </div>
    </el-card>
    
    <el-row :gutter="20" class="stats-row">
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-content">
            <UserOutlined class="stat-icon" style="color: #409EFF" />
            <div class="stat-info">
              <div class="stat-number">128</div>
              <div class="stat-label">家族成员</div>
            </div>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-content">
            <FolderOutlined class="stat-icon" style="color: #67C23A" />
            <div class="stat-info">
              <div class="stat-number">5</div>
              <div class="stat-label">家族树</div>
            </div>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-content">
            <EnvironmentOutlined class="stat-icon" style="color: #E6A23C" />
            <div class="stat-info">
              <div class="stat-number">42</div>
              <div class="stat-label">地理位置</div>
            </div>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-content">
            <LockOutlined class="stat-icon" style="color: #F56C6C" />
            <div class="stat-info">
              <div class="stat-number">3</div>
              <div class="stat-label">管理员</div>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
    
    <el-row :gutter="20" class="features-row">
      <el-col :span="12">
        <el-card class="feature-card">
          <template #header>
            <div class="card-header">
              <span>最新活动</span>
            </div>
          </template>
          <div class="activity-list">
            <div class="activity-item" v-for="i in 5" :key="i">
              <UserOutlined style="font-size: 30px" />
              <div class="activity-content">
                <div class="activity-title">用户添加了新的家族成员</div>
                <div class="activity-time">2025-11-10 10:{{ 10 + i }}:{{ 20 + i }}</div>
              </div>
            </div>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="12">
        <el-card class="feature-card">
          <template #header>
            <div class="card-header">
              <span>系统信息</span>
            </div>
          </template>
          <div class="system-info">
            <el-descriptions :column="1" size="small">
              <el-descriptions-item label="系统版本">v1.0.0</el-descriptions-item>
              <el-descriptions-item label="Vue版本">3.2.0</el-descriptions-item>
              <el-descriptions-item label="Element Plus版本">2.0.0</el-descriptions-item>
              <el-descriptions-item label="运行环境">开发环境</el-descriptions-item>
              <el-descriptions-item label="最后更新">2025-11-10</el-descriptions-item>
            </el-descriptions>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { UserOutlined, FolderOutlined, EnvironmentOutlined, LockOutlined } from '@ant-design/icons-vue'

export default {
  name: 'Home',
  components: {
    UserOutlined,
    FolderOutlined,
    EnvironmentOutlined,
    LockOutlined
  }
}
</script>

<style scoped>
.dashboard {
  padding: 20px;
}

.welcome-card {
  margin-bottom: 20px;
}

.welcome-content h3 {
  margin-top: 0;
  color: #333;
}

.welcome-content p {
  color: #666;
  font-size: 16px;
}

.stats-row {
  margin-bottom: 20px;
}

.stat-card {
  height: 120px;
}

.stat-content {
  display: flex;
  align-items: center;
  height: 100%;
}

.stat-icon {
  font-size: 36px;
  margin-right: 20px;
}

.stat-number {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

.stat-label {
  font-size: 14px;
  color: #666;
}

.features-row {
  margin-bottom: 20px;
}

.activity-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-content {
  margin-left: 15px;
}

.activity-title {
  font-size: 14px;
  color: #333;
  margin-bottom: 5px;
}

.activity-time {
  font-size: 12px;
  color: #999;
}

.system-info {
  padding: 10px 0;
}
</style>